//
// Created by Arikes on 9/19/21.
// 建造者模式

#ifndef DESIGNERMODE_DIRECTOR_H
#define DESIGNERMODE_DIRECTOR_H

#include "ConcreteBuilder.h"
namespace BuildMode{
    class Director{
    public:
        Director(Builder* builder){
            _builder = builder;
        }

        Product constructPruduct()
        {
            std::cout<<"Product::constructPruduct() "<<std::endl;
            _builder->buildPartA();
            _builder->buildPartB();
            _builder->buildPartC();
            return _builder->getResult();
        }
    private:
        Builder* _builder;
    };
}

#endif //DESIGNERMODE_DIRECTOR_H

//BuildMode::Builder* builder = new BuildMode::ConcreteBuilder();
//BuildMode::Director* director = new BuildMode::Director(builder);
//BuildMode::Product product = director->constructPruduct();
//product.showParts();